package arithmetic;

/**
 * @author jiangfeng
 * Created on 2019-09-05
 *
 * 测试 jvm中  重新和重载
 */
public class TestJVM {

    public static void main(String[] args) {
        A a = new A();
        A b = new B();
        C c = new C();
        C d = new D();

        a.show(c);
        b.show(c);
        a.show(d);

        b.show(d);
    }


}

class A{
    public void show(C c){
        System.out.println("AC");
    }

    public void show(D d){
        System.out.println("AD");
    }
}

class B extends A{
    public void show(C c){
        System.out.println("BC");
    }

    public void show(D d){
        System.out.println("BD");
    }
}

class C {}

class D extends C{}